﻿using ApplicationBase.Core.Domain;

namespace IdentityService.Domain.Aggregates.RoleAggregate
{
    public class RolePermit : Entity, IEquatable<RolePermit>
    {
        public long Id { get; init; }
        public long RoleId { get; init; }
        public long PermitId { get; init; }

        public RolePermit(long id, long roleId, long permitId)
        {
            Id = id;
            RoleId = roleId;
            PermitId = permitId;
        }

        public bool Equals(RolePermit? other)
        {
            return other != null && RoleId == other.RoleId && PermitId == other.PermitId;
        }
    }
}
